# 编译器配置
CC = gcc
CFLAGS = -Wall -O2

# 自动获取源文件
SRC = $(wildcard *.c)
OBJ = $(SRC:.c=.o)
TARGET = main

run: $(TARGET)
	./$(TARGET)
	python spi_plot.py

$(TARGET): $(OBJ)
	$(CC) $(CFLAGS) $^ -o $@

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@